package apibasej.db.to;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;

import apibasej.xml.NodeXML;

@SuppressWarnings("serial")
@NodeXML
public class ResultSelect implements Serializable{
	
	//@NodeXML(value="column-names",nameTagItem="col")
	//private ArrayList<String> nameCols;
	
	// tem que ser map, pois se o valor for null não irá adicionar o item e irá bagunçar a ordem
	// a primeira coluna tem o indice 0
	@NodeXML(value="rows",nameTagItem="row")
	private ArrayList<LinkedHashMap<Integer,Object>> rows; 

	@NodeXML(asAttribute=true) 
	private int ctCols = 0;
	
	@NodeXML 
	private Integer totalCountWithoutPagination;
	
	/*
	public ArrayList<String> getNameCols() {
		if(nameCols==null) {
			nameCols = new ArrayList<String>();
		}
		return nameCols;
	}
	public void setNameCols(ArrayList<String> nameCols) {
		this.nameCols = nameCols;
	}*/
	
	public ArrayList<LinkedHashMap<Integer,Object>> getRows() {
		if(rows==null) {
			rows = new ArrayList<LinkedHashMap<Integer,Object>>();
		}
		return rows;
	}
	
	public void setRows(ArrayList<LinkedHashMap<Integer,Object>> rows) {
		this.rows = rows;
	}
	public Integer getTotalCountWithoutPagination() {
		return totalCountWithoutPagination;
	}
	public void setTotalCountWithoutPagination(Integer totalCountWithoutPagination) {
		this.totalCountWithoutPagination = totalCountWithoutPagination;
	}

	public int getCtCols() {
		return ctCols;
	}
	public void setCtCols(int ctCols) {
		this.ctCols = ctCols;
	}
	
	
	
}

